package com.woniuxy.service.impl;


import java.util.List;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.ArrayList;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.woniuxy.mapper.OrderMapper;
import com.woniuxy.pojo.Guest;
import com.woniuxy.pojo.Opinon;
import com.woniuxy.pojo.Order;
import com.woniuxy.pojo.Order2;
import com.woniuxy.pojo.OrderDetail;
import com.woniuxy.pojo.OrderDetailgjf;
import com.woniuxy.pojo.OrderDetaillyq;
import com.woniuxy.pojo.Order_dgy;
import com.woniuxy.pojo.Ordergjf;
import com.woniuxy.pojo.Room;
import com.woniuxy.pojo.Roomgjf;
import com.woniuxy.service.OrderService;

@Service
public class OrderServiceImp implements OrderService{
	@Resource
	private OrderMapper ordermapper;

	//查询房间信息
	@Override
	public Roomgjf findRoomByRid(int rid) {
		return ordermapper.findroom(rid);
	}

	@Override
	public List<Guest> findAllGuest(int uid) {
		return ordermapper.findGuset(uid);
	}
		

	@Override
	public ArrayList<OrderDetaillyq> findByOid(int oid) {
		return ordermapper.findByOid(oid);

	}

	@Override
	public int saveOpinion(int odid, Float grade, String opinion) {
		return ordermapper.saveOpinion(odid,grade,opinion);
	}

	@Override
	public int updateState(int odid,String state) {
		return ordermapper.updateState(odid,state);
	}

	@Override
	public ArrayList<Opinon> allOpinion() {
		return ordermapper.allOpinion();
	}
	
	public float findMemberInf(int uid) {
		return ordermapper.findMember(uid);
	}

	@Override
	public float findDidcount1() {
		return ordermapper.findDiscount1();
	}

	@Override
	public float findDidcount2() {
		return ordermapper.findDiscount2();
	}

	@Override
	public String createOrder(Order order) {
		String result="订单创建失败！";
		int re= ordermapper.creOrder(order);
		System.out.println("更新行数---"+re);
		if(re>0){
			result="订单创建成功！";
		}
		return result;
	}

	@Override
	public int findOid(String onumber) {
		return ordermapper.findOidByOnumber(onumber);
	}

	@Override
	public String createOrderList(OrderDetailgjf ol) {
		String result="订单创建失败！";
		int re=ordermapper.cl(ol);
		System.out.println("更新行数---"+re);
		if(re>0){
			result="订单创建成功！";
		}
		return result;
	}

	@Override
	public void changeStateByOid(int oid,String ostate) {
		ordermapper.changeStateByOid(oid,ostate);
	}

	@Override
	public void changeDeleByOid(int oid, int i) {
		ordermapper.changeDeleByOid(oid, i);
	}

	@Override
	public ArrayList<Order2> all2() {
		return ordermapper.all2();
	}

	@Override
	public ArrayList<Order> all(int uid) {
		return ordermapper.all(uid);
	}

	@Override
	public ArrayList<Opinon> allOpinion2() {
		return ordermapper.allOpinion2();
	}
	@Override
	public ArrayList<Opinon> allOpinion3() {
		return ordermapper.allOpinion3();
	}
	@Override
	public ArrayList<Opinon> allOpinion4() {
		return ordermapper.allOpinion4();
	}
	
	@Override
	public int addOrder(Order_dgy order) {
		return ordermapper.addOrder(order);
	}

	@Override
	public Order_dgy findByOrder(Order_dgy order) {
		return ordermapper.findByOrder(order);
	}

	@Override
	public int changeOrder(Order_dgy order) {
		return ordermapper.changeOrder(order);
	}

	@Override
	public List<Order_dgy> findAll() {
		return ordermapper.findAll();
	}

	@Override
	public Order_dgy findOrderByMessage(String message) {
		return ordermapper.findOrderByMessage(message);
	}

	@Override
	public Order_dgy findById(String oid) {
		return ordermapper.findById(oid);
	}

	@Override
	public List<Order_dgy> completeOrder() {
		return ordermapper.completeOrder();
	}

	@Override
	public List<Order_dgy> cancelOrder() {
		return ordermapper.cancelOrder();
	}

	@Override
	public int deleteOrder(String oNumber) {
		return ordermapper.deleteOrder(oNumber);
	}








	
}
